package cn.dglydrpy.study.spring.transactional;
/**
 * @Description:  
 * @author:LY_飘涯
 * @date:2019年6月5日 上午10:31:46 
 * @version:1.0
 */

import javax.annotation.Resource;

import org.junit.Test;
import org.springframework.transaction.support.TransactionTemplate;


public class ProgramTransactional {
	
	@Resource
	private TransactionTemplate template;
	
	@Test
	public void test() {
		boolean isSuccess1 = template.execute(status -> {
			//事务操作1
			return true;
		});
		
		//调用远程Api
		
		boolean isSuccess2 = template.execute(status -> {
			//事务操作2
			return true;
		});
	}

}
